<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$basic=$this->plugin_setting('basic');
$return['banner']=$basic['image'];
$return['basic']=$basic;
//质疑
if($_RQ['op']=='main'){
	$id=$_RQ['id'];
    $this->session('id',$id);
	if(!$id){
		exi('未找到项目信息！','error');
	}
	$isjubao=pdo_get('jy_zhongchou_jubao',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'pid'=>$id));
	$type=array('1'=>'筹款金额超过疾病所需','2'=>'多次筹款(包括其他平台)','3'=>'病情描述不符','4'=>'家庭经济情况良好','5'=>'患者已去世','6'=>'患者有购买保险、有医疗赔付','7'=>'事故纠纷','8'=>'虚假筹款','9'=>'其他');
	if($isjubao){
		exi('您已举报过了哦！','error');
	}
	$return['post']=array();
	$return['type']=$type;
	exi($return);

}
if($_RQ['op']=='submit'){
	$id=$this->session('id');
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$insert=array(
			'uniacid'=>$_SESSION['uniacid'],
			'mid'=>$_SESSION['uid'],
			'pid'=>$id,
			'type'=>$postdata['tid'],
			'reason'=>$postdata['reason'],
			'images'=>ijson_encode($postdata['images']),
			'createtime'=>TIMESTAMP
		);
		pdo_insert('jy_zhongchou_jubao',$insert);
		exi('提交成功','','jy_zhongchou/p_detail//id='.$id);
}
}
	
